<template>
	<view class="mainCss">
		<view class="titleBox">
			<view class="titleLeft">
				<img src="../../static/title/back.png" class="titleBack" @click="goBack">
			</view>
			<view class="titleText">
				<text>需求发布</text>
			</view>
			<view class="titleRight">
				
			</view>
		</view>
		<view class="bodyBox">
			<view class="demandBox" v-for="(item, index) in typeList" :key="index" @click="navToItem(index)">
				<img :src="item.imgUrl" class="demandImg">
				<text style="width: 500rpx;">{{item.name}}</text>
				<img src="../../static/home/right.png" class="demandMore">
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				typeList: [{
					imgUrl: '../../static/demand/shop.png',
					name: '发布商铺出租'
				}, {
					imgUrl: '../../static/demand/shopchange.png',
					name: '发布商铺转让'
				}, {
					imgUrl: '../../static/demand/office.png',
					name: '发布办公出租'
				}, {
					imgUrl: '../../static/demand/officechange.png',
					name: '发布办公转让'
				}, {
					imgUrl: '../../static/demand/personal.png',
					name: '发布个人求租'
				}],
			}
		},
		onLoad() {
			
		},
		methods: {
			goBack() {
				uni.switchTab({
					url: '/pages/home/index',
				})
			},
			// 跳转子菜单
			navToItem(i) {
				switch (i) {
					case 0:
						uni.navigateTo({
							url: '/pagesA/shop-rent-out/shop-rent-out'
						})
						break;
					case 1:
						uni.navigateTo({
							url: '/pagesA/shop-yield/shop-yield'
						})
						break;
					case 2:
						uni.navigateTo({
							url: '/pagesA/work-rent/work-rent'
						})
						break;
					case 3:
						uni.navigateTo({
							url: '/pagesA/work-yield/work-yield'
						})
						break;
					case 4:
						uni.navigateTo({
							url: '/pagesA/personage-yield/personage-yield'
						})
						break;
				}
			}
		}
	}
</script>

<style>
	@import '../../css/demand.css';
	
	.bodyBox {
		align-items: center;
	}
</style>